const mongoose = require('mongoose')

// 创建文章数据模型
module.exports = new mongoose.Schema({
  slug: {
    type: String,
    required: true
  },
  title: {
    type: String,
    required: true
  },
  description: {
    type: String,
    required: true
  },
  body: {
    type: String,
    default: null
  },
  tagList: {
    type: Array,
    default: []
  },
  ...require('./base-model'),
  favorited: {
    type: Boolean,
    default: false
  },
  favoritesCount: {
    type: Number,
    default: 0
  }
})
